<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../js/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{url}}</h1>
        <a href="#">去百度报错</a>
        <a :href="url">去百度2</a>

        <img @click="handle" width="300" :src="pics[i]" />
    </div>
</body>
<script>
var vm = new Vue({
    el: "#app",
    data:{
        url: 'http://baidu.com',
        pics: [
            "../img/fish.png",
            "../img/lu.png",
            "../img/ma.png",
        ],
        i: 0 
    },
    methods:{
        handle(){
            this.i = ( this.i+1 )%3 
            console.log( this.i );
        }
    }
});
</script>
</html>